localparam STATE_WIDTH = 5;
localparam
		IDLE = 5'b00000,
		RECV_META = 5'b00001,
		META_ACK = 5'b00011,
		FLASH_WRITE_INIT_TRANSFER = 5'b00010,
		FLASH_WRITE_DO_WRITE = 5'b00110,
		FLASH_WRITE_RESTORE_CTL = 5'b00111,
		FLASH_READ_INIT_TRANSFER = 5'b00101,
		FLASH_READ_DO_READ = 5'b00100,
		FLASH_ERASE_START = 5'b01100,
		FLASH_ERASE_WAIT = 5'b01101,
		RAM_WRITE_INIT_TRANSFER = 5'b01111,
		RAM_WRITE_DO_WRITE = 5'b01110,
		RAM_WRITE_RESTORE_CTL = 5'b01010,
		RAM_READ_INIT_TRANSFER = 5'b01011,
		RAM_READ_DO_READ = 5'b01001,
		WAITING_UART_SEND = 5'b01000,
		WAITING_UART_SEND_1 = 5'b11000,
		RECV_FROM_COM = 5'b11001,
		SEND_TO_COM = 5'b11011,
		SEND_CHECKSUM_AND_IDLE = 5'b11010,
		ERROR = 5'b11110;
